<?php
include "conn.php"; //数据库连接

//对比用户名和密码

if(isset($_POST['tel']) && isset($_POST['pass'])){
    $tel = $_POST['tel'];
    $pass = sha1($_POST['pass']);
    $result = $conn->query("select * from registry where tel='$tel' and password='$pass'");
    if($result->fetch_assoc()){
        echo 2;//成功
    }else{
        echo 1;//失败
    }
}

